<template>
  <div class="fillcontain">
    <head-top></head-top>
    <div class="table_container">
      <el-table
        v-loading="loading"
        :data="tableData"
        height="600"
        style="width: 100%">
          <template v-for="colConfig in colConfigs">
              <slot v-if="colConfig.slot" :name="colConfig.slot">
                  <el-table-column >
                      <el-button type="primary" slot-scope="{ row }">{{colConfig.slot}}</el-button>
                  </el-table-column>
              </slot>
              <el-table-column v-else v-bind="colConfig"></el-table-column>
          </template>
      </el-table>
      <div class="Pagination" style="text-align: left;margin-top: 10px;">
        <el-pagination
          :page-size="20"
          layout="total, prev, pager, next"
          :total="count">
        </el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
  import headTop from '../components/headTop'
    export default {
        name: "contentTable",
        data() {
            return {
                offset: 0,
                limit: 20,
                count: 30,
                currentPage: 1,
            }
        },
        components: {
          headTop
        },
        props: {
          tableData: {
            type: Array,
          },
          colConfigs: {
            type: Array,
          }
        },
        computed: {
            loading: function () {
                if(this.tableData.length === 0)
                    return true
                else
                    return false
            }
        }
    }
</script>

<style scoped>

</style>
